home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / import / gradientimport / common / gradientimport.r < prev    next >
Encoding:
Text File  |  1996-11-08  |  6.5 KB  |  221 lines

  1. /*
  2.     File: GradientImport.r
  3.  
  4.     Copyright (c) 1990, Thomas Knoll.
  5.     Copyright (c) 1993-6, Adobe Systems Incorporated.
  6.     All rights reserved.
  7.  
  8.     Rez source file for GradientImport example.
  9. */
  10.  
  11. /***************************************************************/
  12. /* Defines required by include files */
  13.  
  14. #define plugInName            "GradientImport"
  15. #define VersionString        "4.0"
  16.  
  17. /***************************************************************/
  18.  
  19. #if Macintosh
  20. #include "Types.r"
  21. #include "SysTypes.r"
  22. #include "PIGeneral.r"
  23. #include "PIUtilities.r"
  24. #include "DialogUtilities.r"
  25. #endif
  26.  
  27. #if MSWindows
  28. #include "PIGeneral.h"
  29. #include "PIUtilities.r"
  30. #include "WinDialogUtils.r"
  31. #endif
  32.  
  33. #include "PIActions.h"
  34.  
  35. /***********************************************************/
  36. /* Version information. */
  37.  
  38. #define plugInComment "gradientimport example import plug-in"
  39. #define vendorName                        "AdobeSDK"
  40. #define ourSuiteID                        'sdK3'
  41. #define ourClassID                        'graD'
  42. #define ourEventID                        typeNull // must be this
  43.  
  44. #define keyMultiImportInfo                'mulK'
  45. #define classMultiImportStruct            'mulS'
  46. #define keyOurMode                        keyMode
  47. #define keyRows                            keyHorizontal
  48. #define keyColumns                        keyVertical
  49. #define typeGradientMode                'grmT'
  50.     #define ourBitmapMode                'bitM'
  51.     #define ourGrayscaleMode            'gryS'
  52.     #define ourIndexedColorMode            'indX'
  53.     #define ourRGBColorMode                'rgbC'
  54.  
  55. #define errHowdWeGetHere                16989
  56.  
  57. /****************************************************************/
  58.  
  59. resource 'PiPL' (ResourceID, purgeable)
  60.     {
  61.         {
  62.         Kind { Acquire },
  63.         Name { plugInName "..." },
  64.         Version { (latestAcquireVersion << 16) | latestAcquireSubVersion },
  65.         #if Macintosh
  66.         Code68K { Acquire, $$ID },
  67.         CodePowerPC { 0, 0, "" },        
  68.         #else
  69.         CodeWin32X86 { "ENTRYPOINT" },
  70.         #endif
  71.  
  72.         HasTerminology { ourClassID, ourEventID, ResourceID, "" },
  73.         /* class ID, event ID, aete ID, uniqueString */
  74.  
  75.         }
  76.     };
  77.  
  78. resource 'PiMI' (ResourceID, purgeable)
  79.       latestAcquireVersion,
  80.       latestAcquireSubVersion,
  81.       0,
  82.       supportsBitmap +
  83.       supportsGrayScale +
  84.       supportsIndexedColor +
  85.       supportsRGBColor,
  86.       '    ', /* No required host */
  87.       {},
  88. };
  89.  
  90. /* About resources */
  91.  
  92. resource StringResource (AboutID, "About Text", purgeable)
  93. {
  94.     plugInName "\n\n"
  95.     "Version " VersionString " "
  96.     "Release " ReleaseString "\n"
  97.     "Copyright ⌐ 1992-6, Adobe Systems Incorporated.\n"
  98.     "All rights reserved.\n\n"
  99.     "An example import plug-in module for Adobe Photoshop¿."
  100. };
  101.  
  102. /* Parameters dialog box */
  103.  
  104. resource 'DLOG' (ResourceID+1, "UI", purgeable)
  105.     {
  106.     {0, 0, 190, 255},
  107.     movableDBoxProc,
  108.     visible,
  109.     noGoAway,
  110.     0x0,
  111.     ResourceID+1,
  112.     plugInName
  113.     };
  114.  
  115. resource 'DITL' (ResourceID+1, "UI", purgeable)
  116.     {
  117.         {
  118.         {15, 180, 35, 240},   Button { enabled, "Import" },
  119.         {45, 180, 65, 240},   Button { enabled, "Done" },
  120.         {10, 90, 26, 135},      EditText { enabled, "" },
  121.         {36, 90, 52, 135},      EditText { enabled, "" },
  122.         {83, 30, 99, 150},    RadioButton { enabled, "Bitmap" },
  123.         {99, 30, 115, 150},   RadioButton { enabled, "Grayscale" },
  124.         {115, 30, 131, 150},  RadioButton { enabled, "Indexed Color" },
  125.         {131, 30, 147, 150},  RadioButton { enabled, "RGB Color" },
  126.         {165, 30, 181, 150},  CheckBox { enabled, "Invert" },
  127.         {10, 40, 26, 85},      StaticText { disabled, "Rows:" },
  128.         {36, 20, 52, 85},      StaticText { disabled, "Columns:" },
  129.         {70, 20, 155, 160},   UserItem { disabled },
  130.         {62, 30, 78, 67},      StaticText { disabled, "Mode" }
  131.         }
  132.     };
  133.  
  134. /* Scripting resource */
  135.  
  136. resource 'aete' (ResourceID, purgeable)
  137. {
  138.     1, 0, english, roman,                                    /* aete version and language specifiers */
  139.     {
  140.         vendorName,                                            /* vendor suite name */
  141.         "Adobe example plug-ins",                            /* optional description */
  142.         ourSuiteID,                                            /* suite ID */
  143.         1,                                                    /* suite code, must be 1 */
  144.         1,                                                    /* suite level, must be 1 */
  145.         {},                                                    /* structure for filters */
  146.         {                                                    /* non-filter plug-in class here */
  147.             vendorName " gradientImport",                    /* unique class name */
  148.             ourClassID,                                        /* class ID, must be unique or Suite ID */
  149.             "gradientImport plug-in",                        /* optional description */
  150.             {                                                /* define inheritance */
  151.                 "<Inheritance>",                            /* must be exactly this */
  152.                 keyInherits,                                /* must be keyInherits */
  153.                 classImport,                                /* parent: Format, Import, Export */
  154.                 "parent class import",                        /* optional description */
  155.                 flagsSingleProperty,                        /* if properties, list below */
  156.  
  157.                 "multi-import",                                /* property name */
  158.                 keyMultiImportInfo,                            /* our key */
  159.                 classMultiImportStruct,                        /* our type */
  160.                 "multiple import info structure",            /* optional description */
  161.                 flagsListProperty
  162.             },
  163.             {}, /* elements (not supported) */
  164.         /* other classes... */
  165.             "import info",                                    /* unique class name */
  166.             classMultiImportStruct,                            /* class key */
  167.             "class import info",                            /* optional description */
  168.             {
  169.                 "rows",                                        /* property name */
  170.                 keyRows,                                    /* rows key */
  171.                 typeFloat,                                    /* float, later pin to unixPixels */
  172.                 "number of rows",                            /* optional description */
  173.                 flagsSingleProperty,                        /* properties */
  174.                 
  175.                 "columns",                                    /* property name */
  176.                 keyColumns,                                    /* columns key */
  177.                 typeFloat,                                    /* float, later pin to unitPixels */
  178.                 "number of columns",                        /* optional description */
  179.                 flagsSingleProperty,                        /* properties */
  180.                 
  181.                 "mode",                                        /* property name */
  182.                 keyOurMode,                                    /* our mode key */
  183.                 typeGradientMode,                            /* our modes */
  184.                 "color mode",                                /* optional description */
  185.                 flagsEnumeratedProperty,                    /* enumeration. See class below. */
  186.  
  187.                 "invert",                                    /* property name */
  188.                 keyInvert,                                    /* our key, 'invR' */
  189.                 typeBoolean,                                /* our check box */
  190.                 "invert image",                                /* optional description */
  191.                 flagsSingleProperty                            /* properties */
  192.             },
  193.             {}, /* elements (unsupported) */
  194.         },
  195.         {}, /* comparison ops (not supported) */
  196.         {                                                    /* any enumerations */
  197.             typeGradientMode,                                /* enumeration */
  198.             {
  199.                 "bitmap",                                    /* bitmap mode */
  200.                 ourBitmapMode,                                /* 'bitM' */
  201.                 "bitmap mode",                                /* optional description */
  202.                 
  203.                 "grayscale",                                /* grayscale mode */
  204.                 ourGrayscaleMode,                            /* 'gryS' */
  205.                 "grayscale mode",                            /* optional description */
  206.                 
  207.                 "indexed color",                            /* indexed color mode */
  208.                 ourIndexedColorMode,                        /* 'indX' */
  209.                 "indexed color mode",                        /* optional description */
  210.                 
  211.                 "rgb color",                                /* RGB color mode */
  212.                 ourRGBColorMode,                            /* 'rgbC' */
  213.                 "rgb color mode"                            /* optional description */
  214.  
  215.             },                
  216.         }
  217.     }
  218. };
  219.  
  220.